package css;

public class GenericMethodDemo {
  public static void main(String[] args ) {
    Integer[] integers = {1, 2, 3, 4, 5};
    String[] strings = {"广西", "柳州", "鱼峰区", "柳州职业技术学院"};
    Double[] doubles = {3.1415926};
    Student a=new Student();
    a.Name="丁伟";
    a.Sex="男";
    a.Age=18;
    System.out.println("姓名："+a.Name+" "+"性别："+a.Sex+" "+"年龄："+a.Age+" ");
    Ddd b = new Ddd();
    b.weight="180cm";
    b.height="60kg";
    b.L="18cm";
    System.out.println("身高："+b.weight+" "+"体重："+b.height+" "+"长度："+b.L+" ");
    GenericMethodDemo.<Integer>print(integers);
    GenericMethodDemo.<String>print(strings);
    GenericMethodDemo.<Double>print(doubles);
  }

  public static <E> void print(E[] list) {
    for (int i = 0; i < list.length; i++)
      System.out.print(list[i] + " ");
    System.out.println();
  }
}
